<template>
    <div>
        <template v-for="(item, index) in userNav">
            <el-menu-item :index="item.path" v-if="!item.hidden && !item.children">
                {{ item.name }}
            </el-menu-item>
            <el-submenu :index="item.path" v-if="!item.hidden && item.children">
                <template slot="title">{{ item.name }}</template>
                <nav-menu :user-nav="item.children"/>
            </el-submenu>
        </template>
    </div>
</template>

<script>
export default {
    name: "navMenu",
    props: {
        userNav: {
            type: Array,
            default: []
        }
    }

}
</script>

<style scoped>

</style>
